![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
The newt female class. More...
#include <Newt.h>
Public Member Functions | |
Newt_Female (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) | |
Newt_Female constructor. More... | |
~Newt_Female () | |
Newt_Female destructor. More... | |
virtual void | ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | Step (void) |
Newt_Female Step code. This is called continuously until all animals report that they are 'DONE'. More... | |
void | ResetEggProduction () |
void | InternalPesticideHandlingAndResponse () |
For handlng of class-specific pesticide effects. More... | |
![]() | |
Newt_Adult (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) | |
Newt_Adult constructor. More... | |
~Newt_Adult () | |
Newt_Male destructor. More... | |
virtual void | Init (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age) |
Initialise object. More... | |
int | GetInPond () |
Returns the current pond status (-1 if not in pond else the pond ref is returned) More... | |
void | SetInPond () |
Forces setting the in pond status to the first pond ref - used only on start-up. More... | |
![]() | |
Newt_Juvenile (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib) | |
Newt_Juvenile constructor. More... | |
~Newt_Juvenile () | |
Newt_Juvenile destructor. More... | |
double | GetWeight () |
Get method for m_weight. More... | |
void | SetWeight (double a_weight) |
Set method for m_weight. More... | |
void | InternalPesticideHandlingAndResponse () |
For handlng of class-specific pesticide effects. More... | |
![]() | |
Newt_Base (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib) | |
Newt constructor. More... | |
void | Init (vector< unsigned > a_pond, Newt_Population_Manager *a_NPM, bool a_reproinhib) |
Intitialise object. More... | |
void | ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib) |
ReInit for object pool. More... | |
~Newt_Base () | |
Newt destructor. More... | |
virtual int | WhatState () |
Returns the state number for display purposes. More... | |
TTypeOfNewtState | st_Develop (void) |
Behavioural state development - does nothing in the base class. More... | |
TTypeOfNewtState | st_Movement (void) |
Behavioural state movement - does nothing in the base class. More... | |
void | st_Dying (void) |
Behavioural state dying. More... | |
virtual void | BeginStep (void) |
The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep. More... | |
virtual void | EndStep (void) |
The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More... | |
unsigned | GetAge () |
A typical interface function - this one returns the Age as an unsigned integer. More... | |
void | SetAge (unsigned a_age) |
A typical interface function - this one sets the Age as an unsigned integer. More... | |
unsigned | GetHomePond () |
A typical interface function - this one returns the home pond reference as an unsigned integer. More... | |
void | SetHomePond (unsigned a_pond) |
A typical interface function - this one sets the home pond reference as an unsigned integer. More... | |
void | InternalPesticideHandlingAndResponse (double) |
For handlng of class-specific pesticide effects. More... | |
![]() | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
virtual bool | OnFarmEvent (FarmToDo) |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Static Public Attributes | |
static unsigned | m_eggproductionvolume = cfg_newteggproductionvolume.value() |
Parameter - holds the max number of eggs that can be produced during breeding. More... | |
static unsigned | m_eggdailyproductionvolume = cfg_newtdailyeggproductionvolume.value() |
Parameter - holds the number of eggs produced per day during breeding. More... | |
![]() | |
static double | m_AdultPPPThreshold = cfg_NewtAdultPPPToxTrigger.value() |
The threshold for effect of PPP on adults. More... | |
static double | m_AdultPPPElimRate = cfg_NewtAdultPPPToxEliminationRate.value() |
The daily proportion of PPP body burden that is not eliminated for adults. More... | |
static double | m_AdultPPPEffectProbability = cfg_NewtAdultPPPEffectProbability.value() |
The daily probability of effect if above m_AdultPPPThreshold for adults. More... | |
static unsigned | m_AdultLifespan = cfg_NewtAdultLifespan.value() |
static int | m_newtadultwalkspeed = cfg_NewtWalkSpeed.value()/10 |
The max walking speed of a newt. More... | |
![]() | |
static double | m_JuvenilePPPThreshold_Min = 0 |
The minimum threshold for effect of PPP on juveniles. More... | |
static double | m_JuvenilePPPThreshold_EnvConc = cfg_NewtJuvenilePPPToxTrigger_EnvConc.value() |
The environmental concentration threshold for effect of PPP on juveniles. More... | |
static double | m_JuvenilePPPThreshold_Overspray = cfg_NewtJuvenilePPPToxTrigger_Overspray.value() |
The overspray threshold for effect of PPP on juveniles. More... | |
static double | m_JuvenilePPPElimRate = cfg_NewtJuvenilePPPToxEliminationRate.value() |
The daily proportion of PPP body burden that is not eliminated for juveniles. More... | |
static double | m_JuvenilePPPEffectProbability_EnvConc = cfg_NewtJuvenilePPPEffectProbability_EnvConc.value() |
The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for environmental concentration. More... | |
static double | m_JuvenilePPPEffectProbability_Overspray = cfg_NewtJuvenilePPPEffectProbability_Overspray.value() |
The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for overspray. More... | |
static double | m_JuvenileDailyWeightGain = cfg_NewtJuvenileDailyLengthGain.value() |
Used in determining daily growth. More... | |
static int | m_SimW = 0 |
The width of the simulation map, stored for fast access. More... | |
static int | m_SimH = 0 |
The height of the simulation map, stored for fast access. More... | |
static double | m_roadmortalityprob = cfg_NewtRoadMortalityProb.value() |
The probability of death when crossing a road. More... | |
static int | m_newtwalkspeed = cfg_NewtWalkSpeed.value() |
The max walking speed of a newt. More... | |
static int | m_newtwalkstepsize = cfg_NewtWalkStepsize.value() |
The size of a step when evaluating habitat during walking. More... | |
static double | m_goodhabitatdispersalprob = cfg_newtgoodhabitatdispersalprob.value() |
Probability of dispersal in good habitat. More... | |
static double | m_poorhabitatdispersalprob = cfg_newtpoorhabitatdispersalprob.value() |
Probability of dispersal in poor habitat. More... | |
static double | m_NewtDormancyTemperature = cfg_newtdormancytemp.value() |
Temperature in degrees that the newts become dormant. More... | |
static double | m_NewtDormancyHumidity = cfg_newtdormancyhumidity.value() |
Temperature in degrees that the newts become dormant. More... | |
![]() | |
static double | m_EggDevelopmentDDTotal = cfg_NewtEggDevelTotal.value() |
static double | m_EggDevelopmentDDParameter = cfg_NewtEggDevelDDParameter.value() |
static double | m_JuvenileDevelopmentSize = cfg_NewtJuvenileDevelSize.value() |
static double | m_EggMortalityChance = cfg_NewtEggMortalityChance.value() |
static double | m_JuvenileMortalityChance = 0.0 |
static double | m_AdultMortalityChance = 0.0 |
static bool | m_test_pesticide_egg = cfg_Newt_Test_Pesticide_Egg.value() |
Flags to record whether we are in pesticide testing mode. More... | |
static bool | m_test_pesticide_larva = cfg_Newt_Test_Pesticide_Larva.value() |
static bool | m_test_pesticide_terrestrial = cfg_Newt_Test_Pesticide_Terrestrial.value() |
Protected Member Functions | |
virtual TTypeOfNewtState | st_Develop (void) |
Male development state. More... | |
virtual TTypeOfNewtState | st_Breed (void) |
Female breeding in pond. More... | |
virtual TTypeOfNewtState | st_EvaluateHabitat (void) |
Adult evaluate habitat behaviour - augmenting the adult behaviour. More... | |
![]() | |
void | CalcMovementVector (void) |
Calculates the direction needed to move in to get to the target pond. More... | |
bool | AgeMortTest (void) |
Ages the adult and applies a daily mortality probability. More... | |
virtual TTypeOfNewtState | st_Disperse (void) |
Adult development state. More... | |
virtual TTypeOfNewtState | st_Overwinter (void) |
Adult dormant state. More... | |
virtual TTypeOfNewtState | st_Migrate (void) |
Adult migration to pond state. More... | |
![]() | |
virtual TTypeOfNewtState | st_NextStage (void) |
Juvenile maturation. More... | |
void | MoveTo (TTypeDirectedWalk a_directedness, int a_stepsize, int a_steps) |
Top level control of newt movement. More... | |
void | NewtDoWalking (int &a_vector, int a_stepsize, int a_steps, int &vx, int &vy) |
This method moves the newt through the landscape. More... | |
void | NewtDoWalkingCorrect (int &a_vector, int a_stepsize, int a_steps, int &vx, int &vy) |
This method moves the newt through the landscape using wrap around corrects. More... | |
int | NewtMoveQuality (int a_x, int a_y, TTypesOfLandscapeElement &a_tole) |
Tests the habitat quality for a square to move to. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
unsigned | m_eggsproduced |
Holds the number of eggs produced during breeding. More... | |
bool | m_mated |
Flag showing mating status, true means mated this season. More... | |
![]() | |
int | m_targetpondx |
x-coord of a target pond More... | |
int | m_targetpondy |
y-coord of a target pond More... | |
![]() | |
int | m_InPond |
The polyrefindex for the pond the newt is in, or -1 if not in a pond. More... | |
double | m_weight |
unsigned | m_OurVector |
The last direction we moved in. More... | |
TTypesOfLandscapeElement | m_CurrentHabitat |
The current habitat type the newt is in. More... | |
bool | m_forcedisperse |
A flag to force dispersal from the breeding ponds. More... | |
![]() | |
TTypeOfNewtState | m_CurrentNewtState |
Variable to record current behavioural state. More... | |
unsigned | m_Age |
vector< unsigned > | m_pondlist |
Newt_Population_Manager * | m_OurPopulationManager |
This is a time saving pointer to the correct population manager object. More... | |
double | m_body_burden |
The current PPP body burden for use in pesticide testing mode. More... | |
bool | m_reproductiveinhibition |
A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent classes) More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
The newt female class.
Newt_Female::Newt_Female | ( | int | a_x, |
int | a_y, | ||
vector< unsigned > | a_pond, | ||
Landscape * | a_L, | ||
Newt_Population_Manager * | a_NPM, | ||
unsigned | a_age, | ||
bool | a_reproinhib | ||
) |
Newt_Female constructor.
Sets the mated status to false and the number of eggs produced to zero
References m_eggsproduced, and m_mated.
Newt_Female::~Newt_Female | ( | void | ) |
Newt_Female destructor.
void Newt_Female::InternalPesticideHandlingAndResponse | ( | ) |
For handlng of class-specific pesticide effects.
This method is re-implemented from Newt_Base for any class which has pesticide response behaviour. If the body burden exceeds the trigger then an effect is tested for and implemented depending on the pesticide type.
References g_msg, g_rand_uni, TAnimal::KillThis(), Newt_Adult::m_AdultPPPEffectProbability, Newt_Adult::m_AdultPPPThreshold, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, TAnimal::m_OurLandscape, Landscape::SupplyPesticideType(), toNewts_Die, ttop_AcuteEffects, ttop_MultipleEffects, ttop_NoPesticide, ttop_ReproductiveEffects, and MapErrorMsg::Warn().
Referenced by st_Develop().
|
virtual |
Used to re-use an object - must be implemented in descendent classes.
Reimplemented from Newt_Adult.
References m_eggsproduced, m_mated, and Newt_Adult::ReInit().
Referenced by Newt_Population_Manager::CreateObjects().
|
inline |
|
protectedvirtual |
Female breeding in pond.
This is the behaviour of the female in the breeding pond during breeding season. Behaviour consists of:
References struct_Newt::age, Newt_Adult::AgeMortTest(), Newt_Population_Manager::CreateObjects(), g_msg, Newt_Population_Manager::IsBreedingSeason(), struct_Newt::L, Newt_Base::m_Age, TALMaSSObject::m_CurrentStateNo, m_eggdailyproductionvolume, m_eggproductionvolume, m_eggsproduced, Newt_Juvenile::m_InPond, TAnimal::m_Location_x, TAnimal::m_Location_y, m_mated, TAnimal::m_OurLandscape, Newt_Base::m_OurPopulationManager, Newt_Base::m_reproductiveinhibition, struct_Newt::NPM, struct_Newt::pondrefs, struct_Newt::reproinhib, Landscape::SupplyElementType(), Landscape::SupplyMaleNewtPresent(), toNewts_Breed, toNewts_Develop, toNewts_Die, tton_Egg, MapErrorMsg::Warn(), struct_Newt::weight, struct_Newt::x, and struct_Newt::y.
Referenced by Step().
|
protectedvirtual |
Male development state.
Adds pesticide handling to the Adult version of st_Develop If there is the need to test for pesticide effects then the body-burden is adjusted for yesterdays elimination, then pesticide at this location is determined and any intake stored. InternalPesticideHandlingAndResponse is called, and if the body-burden is greater than the threshold for effects then the impacts are determined.
Reimplemented from Newt_Adult.
References InternalPesticideHandlingAndResponse(), Newt_Adult::m_AdultPPPElimRate, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Newt_Base::m_test_pesticide_terrestrial, ppp_1, Newt_Adult::st_Develop(), Landscape::SupplyPesticide(), and toNewts_Die.
Referenced by Step().
|
protectedvirtual |
Adult evaluate habitat behaviour - augmenting the adult behaviour.
The female must not stay in breeding behaviour if she has produced her eggs, so this augmentation of evaluate habitat prevents that happening.
The first thing to determine is whether this is the breeding season or not. This is controlled by the population manager. If it is breeding then:
If in a pond and after the NEWT_BREEDINGSEAONEND but before NEWT_BREEDINGSEAONEND+30 then it will disperse based on a probability which reaches unity by NEWT_BREEDINGSEAONEND+30. If its not the breeding season and not in pond then evaluate habitat and determine the dispersal necessity. This is identical to the juvenile st_EvaluateHabitat, which is what is called.
Reimplemented from Newt_Adult.
References g_rand_uni, Newt_Population_Manager::IsBreedingSeason(), m_eggproductionvolume, m_eggsproduced, Newt_Juvenile::m_forcedisperse, Newt_Juvenile::m_InPond, Newt_Base::m_OurPopulationManager, Newt_Juvenile::st_EvaluateHabitat(), toNewts_Breed, toNewts_Develop, and toNewts_Migrate.
Referenced by Step().
|
virtual |
Newt_Female Step code. This is called continuously until all animals report that they are 'DONE'.
Reimplemented from Newt_Juvenile.
References Newt_Base::m_CurrentNewtState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Breed(), st_Develop(), Newt_Adult::st_Disperse(), Newt_Base::st_Dying(), st_EvaluateHabitat(), Newt_Adult::st_Migrate(), Newt_Adult::st_Overwinter(), toNewts_Breed, toNewts_Develop, toNewts_Die, toNewts_Dispersal, toNewts_EvaluateLocation, toNewts_InitialState, toNewts_Migrate, toNewts_Overwinter, toNewts_Remove, and Landscape::Warn().
|
static |
Parameter - holds the number of eggs produced per day during breeding.
Referenced by Newt_Population_Manager::Newt_Population_Manager(), and st_Breed().
|
static |
Parameter - holds the max number of eggs that can be produced during breeding.
Newt_Female adds the following attributes to Newt_Adult:
The only new behaviour added to the Newt_Female class is st_Breed which is responsible for carrying out the breeding behaviour when the newt is in the pond
Referenced by Newt_Population_Manager::Newt_Population_Manager(), st_Breed(), and st_EvaluateHabitat().
|
protected |
Holds the number of eggs produced during breeding.
Referenced by Newt_Female(), ReInit(), ResetEggProduction(), st_Breed(), and st_EvaluateHabitat().
|
protected |
Flag showing mating status, true means mated this season.
Referenced by Newt_Female(), ReInit(), and st_Breed().